<!doctype html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <title>管理员登录-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
    <base href="http://localhost:8080"/>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/weadmin.css">
    <script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
</head>

<body class="login-bg">

  <div class="login">
    <div class="message">后台用户注册</div>
    <div id="darkbannerwrap"></div>
    <form class="layui-form" id="reg-form">
      <input name="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
      <hr class="hr15">
      <input name="name" placeholder="昵称" type="text" lay-verify="required" class="layui-input">
      <hr class="hr15">
      <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
      <hr class="hr15">
      <input name="confirmPassword" lay-verify="required|confirmPass" placeholder="确认密码" type="password" class="layui-input">
        <hr class="hr15">
      <input class="loginin" value="注册" lay-submit lay-filter="register" style="width:45%;" type="button">
      <input id="reset" style="width: 45%;float: right; background-color: #2D93CA;" value="重置" type="button"/>
      <hr class="hr20">
      <input id="loginPage" style="width: 100%;background-color: orangered;" value="去登录" type="button"/>
    </form>
  </div>

  <script type="text/javascript">
      layui.config({
          base: 'js/'
      }).extend({ //设定模块别名
          admin: 'admin'
          ,http: 'http'
      });
      layui.use(['form', 'admin', 'http'], function () {
          var form = layui.form
              , admin = layui.admin
              , http = layui.http;
          form.on('submit(register)', function (data) {
              http.register(data.field);
          });
      });
      reset = document.getElementById("reset");
      reset.onclick = function () {
         var formObj = document.getElementById("reg-form");
         for (var i = 0; i < formObj.elements.length; i++) {
             if (formObj.elements[i].type === "text" || formObj.elements[i].type === "password") {
                 formObj.elements[i].value = "";
             }
         }
      };

      loginPage = document.getElementById("loginPage");
      loginPage.onclick = function () {
          location.href = "./login.html";
      };


  </script>
  <!-- 底部结束 -->
</body>
</html>